<?php 
class Country_Form_Manage_Poll extends Engine_Form{
    
    private $_poll ;
    public function setPoll($poll){
        $this->_poll = $poll;
        
    }
    
    private $_countryId = 0;
    public function setCountry($country){
        $this->_countryId = $country;
    }
    
    
    public function  init(){
        $this->setTitle('Poll Value');
        $this->setDescription('Set Value To Poll Options');
        
        
        $options = $this->_poll->getOptions();
        foreach($options as $option){
            $this->addElement('Text',"poll_options_".$option->polloption_id,array(
    			'label' => $option->title,
                'value' => $option->getValue($this->_countryId)
    		));
        }
            
        
        
        $this->addElement('Button', 'submit', array (
			'type' => 'submit', 
			'label' => 'Save', 
			'decorators' => array (
					'ViewHelper'
			)
        ));
		
		$this->addElement('Cancel', 'cancel', array (
				'label' => 'cancel', 
				'link' => true, 
				'prependText' => Zend_Registry::get('Zend_Translate')->_(' or '), 
				'href' => '', 
				'onclick' => 'parent.Smoothbox.close();', 
				'decorators' => array (
						'ViewHelper'
				)
		));
		$this->addDisplayGroup(array (
				'submit', 
				'cancel'
		), 'buttons');
		$button_group = $this->getDisplayGroup('buttons');    
    }
}
?>